﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true" CodeBehind="MaintainStationeryItems.aspx.cs" Inherits="Maintain_supplier_information.WebForm2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div align="center">
        <h2>Maintain Stationery Items</h2>
<br />
        <table class="table-condensed">
            <tr>
                <td><asp:Label ID="lbl_category" runat="server" Text="Category:"></asp:Label></td>
                <td><asp:DropDownList ID="ddl_Category" runat="server" CssClass="form-control">
</asp:DropDownList></td>
                <td><asp:Button ID="btn_search" runat="server" Text="Filter" Height="24px" OnClick="btn_search_Click" CssClass="btn-info" /></td>
            </tr>
        </table>

&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;

    <br />
    <hr />
        <asp:ValidationSummary ID="ValidationSummary1" runat="server" DisplayMode="List" ForeColor="Red" />
        <br />
        <div align="center">
            <asp:Label ID="lblClickMe" runat="server" Text="Click to add new item:"></asp:Label>
            <asp:Button ID="Btn_AddNewItem" runat="server" Text="Add new item" OnClick="Btn_AddNewItem_Click" CssClass="btn-primary" />
        <br />
        <br />
            <asp:GridView ID="gdview_details" runat="server" CssClass="table table-hover table-striped table-bordered table-condensed" AutoGenerateColumns="False" Width="80%">
                <Columns>                    
                    <asp:TemplateField HeaderText="Item Name">
                        <ItemTemplate>
                            <asp:Label ID="lblItemNameLabel" runat="server" Text='<%#Eval("ItemName") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Rank">
                        <ItemTemplate>
                            <asp:Label ID="lblRankLabel" runat="server" Text='<%#Eval("Rank") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Supplier Name">
                        <ItemTemplate>
                            <asp:Label ID="lblSupplierNameLabel" runat="server" Text='<%#Eval("SupplierName") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Phone No">
                        <ItemTemplate>
                            <asp:Label ID="lblPhoneNoLabel" runat="server" Text='<%#Eval("PhoneNo") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Price">
                        <ItemTemplate>
                            <asp:Label ID="lblPrince" runat="server" Text='<%#Eval("Price") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>                    
                </Columns>
        </asp:GridView>
    <br />

        </div>
    

        <asp:GridView ID="GridView1" runat="server" OnRowCancelingEdit="GridView1_RowCancelingEdit" AutoGenerateColumns="False"  OnRowEditing="GridView1_RowEditing" OnRowUpdating="GridView1_RowUpdating" OnRowCommand="GridView1_RowCommand" CssClass="table table-hover table-striped table-bordered table-condensed" Width="80%">
            <Columns>
                <asp:TemplateField HeaderText="Item Code">
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Eval("ItemCode") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Category">
                    <ItemTemplate>
                        <asp:Label ID="Label2" runat="server" Text='<%# Eval("CategoryName") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                
                
                <asp:TemplateField HeaderText="Item Name">
                    <ItemTemplate>
                        <asp:Label ID="Label3" runat="server" Text='<%# Eval("ItemName") %>'></asp:Label>
                    </ItemTemplate>

                </asp:TemplateField>
                
                
                <asp:TemplateField HeaderText="Reorder Level">
                    <ItemTemplate>
                        <asp:Label ID="Label4" runat="server" Text='<%# Eval("ReorderLevel") %>'></asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("ReorderLevel") %>'></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="* Please enter the reorder level" ControlToValidate="TextBox1" ForeColor="Red">*</asp:RequiredFieldValidator>
                        <asp:RangeValidator ID="RangeValidator1" runat="server" ErrorMessage="* Reorder level must be at least 1" ControlToValidate="TextBox1" MaximumValue="2147483647" MinimumValue="1" Type="Integer" ForeColor="Red">*</asp:RangeValidator>
                    </EditItemTemplate>
                </asp:TemplateField>

                
                <asp:TemplateField HeaderText="Reorder Quantity">
                    <ItemTemplate>
                        <asp:Label ID="Label5" runat="server" Text='<%# Eval("ReorderQty") %>'></asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("ReorderQty") %>'></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="* Please enter the reorder quantity" ControlToValidate="TextBox2" ForeColor="Red">*</asp:RequiredFieldValidator>
                        <asp:RangeValidator ID="RangeValidator2" runat="server" ErrorMessage="* Reorder quantity should be at least 1" ControlToValidate="TextBox2" MaximumValue="2147483647" MinimumValue="1" Type="Integer" ForeColor="Red">*</asp:RangeValidator>
                    </EditItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Available Quantity">
                    <ItemTemplate>
                        <asp:Label ID="Label6" runat="server" Text='<%# Eval("AvailableQty") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                
                
                <asp:ButtonField ButtonType="Button" CommandName="Select" Text="Details" >
                
                <ControlStyle CssClass="btn-info" />
                </asp:ButtonField>
                
                <asp:CommandField ShowEditButton="True" />
                
            </Columns>
        </asp:GridView>
    </div>
    
    
        <br />        
</asp:Content>
